/*
  Copyright (C) 2009 Toshiaki Maki <makingx@gmail.com>
  All rights reserved.
  
  Redistribution and use in source and binary forms, with or without modification,
  are permitted provided that the following conditions are met:
  
  1. Redistributions of source code must retain the above copyright notice,
     this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice,
     this list of conditions and the following disclaimer in the documentation
     and/or other materials provided with the distribution.
  3. The name of the author may not be used to endorse or promote products derived
     from this software without specific prior written permission.

  THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
  INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
  DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
  BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
  OF SUCH DAMAGE.
*/

package am.ik.blackpine;

public class BlackPine {
    private long ptr = 0; /* BlackPineインスタンス */
    
    static {
	System.loadLibrary("BlackPine");
    }

    public BlackPine() {
	ptr = createBlackPine();
    }

    protected void finalize() {
	if (ptr != 0) {
	    deleteBlackPine(ptr);
	}
	ptr = 0;
    }
    
    public String getLeftDelimiter()
    {
	return getLeftDelimiter(ptr);
    }

    public void setLeftDelimiter(String delim)
    {
	setLeftDelimiter(ptr, delim);
    }

    public String getRightDelimiter()
    {
	return getRightDelimiter(ptr);
    }

    public void setRightDelimiter(String delim)
    {
	setRightDelimiter(ptr, delim);
    }

    public String getTemplateDir()
    {
	return getTemplateDir(ptr);
    }

    public void setTemplateDir(String dir)
    {
	setTemplateDir(ptr, dir);
    }

    public String getPluginDir()
    {
	return getPluginDir(ptr);
    }

    public void setPluginDir(String dir)
    {
	setPluginDir(ptr, dir);
    }

    public void loadConfig(String file)
    {
	loadConfig(ptr, file);
    }

    public void assign(String key, String value)
    {
	assign(ptr, key, value);
    }

    public void display(String file)
    {
	display(ptr, file);
    }

    public String toString(String file)
    {
	return toString(ptr, file);
    }

    private final static native long createBlackPine();
    private final static native void deleteBlackPine(long ptr);
    private final static native String getLeftDelimiter(long ptr);
    private final static native void setLeftDelimiter(long ptr, String delim);
    private final static native String getRightDelimiter(long ptr);
    private final static native void setRightDelimiter(long ptr, String delim);
    private final static native String getTemplateDir(long ptr);
    private final static native void setTemplateDir(long ptr, String dir);
    private final static native void setPluginDir(long ptr, String dir);
    private final static native String getPluginDir(long ptr);
    private final static native void loadConfig(long ptr, String file);
    private final static native void assign(long ptr, String key, String value);
    private final static native void display(long ptr, String file);
    private final static native String toString(long ptr, String file);
}